package com.tsll.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName ebook
 */
public class Ebook implements Serializable {
    /**
     * 电子图书id
     */
    private Integer ebookId;

    /**
     * 电子图书名称
     */
    private String ebookName;

    /**
     * 电子图书作者
     */
    private String ebookAuthor;

    /**
     * 电子图书发布日期
     */
    @DateTimeFormat(pattern= "yyyy-MM-dd")
    @JsonFormat(pattern= "yyyy-MM-dd",timezone = "GMT+8")
    private Date ebookRedate;

    /**
     * 电子图书描述
     */
    private String ebookDescribe;

    /**
     * 电子图书类型
     */
    private Integer booktypeId;

    /**
     * 电子图书访问频率
     */
    private Integer browsefrequency;

    /**
     * 电子图书图片
     */
    private String bookIco;
    /**
     * 书类型实体类
     */

    private Booktype booktype;
    /**
     * 书章节
     */
    private EbookChapter ebookChapter;

    public EbookChapter getEbookChapter() {
        return ebookChapter;
    }

    public void setEbookChapter(EbookChapter ebookChapter) {
        this.ebookChapter = ebookChapter;
    }

    public Ebook() {
    }

    public Ebook(Integer ebookId, String ebookName, String ebookAuthor, Date ebookRedate, String ebookDescribe, Integer booktypeId, Integer browsefrequency, String bookIco, Booktype booktype, EbookChapter ebookChapter) {
        this.ebookId = ebookId;
        this.ebookName = ebookName;
        this.ebookAuthor = ebookAuthor;
        this.ebookRedate = ebookRedate;
        this.ebookDescribe = ebookDescribe;
        this.booktypeId = booktypeId;
        this.browsefrequency = browsefrequency;
        this.bookIco = bookIco;
        this.booktype = booktype;
        this.ebookChapter = ebookChapter;
    }

    public Booktype getBooktype() {
        return booktype;
    }

    public void setBooktype(Booktype booktype) {
        this.booktype = booktype;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getEbookId() {
        return ebookId;
    }

    /**
     * 
     */
    public void setEbookId(Integer ebookId) {
        this.ebookId = ebookId;
    }

    /**
     * 
     */
    public String getEbookName() {
        return ebookName;
    }

    /**
     * 
     */
    public void setEbookName(String ebookName) {
        this.ebookName = ebookName;
    }

    /**
     * 
     */
    public String getEbookAuthor() {
        return ebookAuthor;
    }

    /**
     * 
     */
    public void setEbookAuthor(String ebookAuthor) {
        this.ebookAuthor = ebookAuthor;
    }

    /**
     * 
     */
    public Date getEbookRedate() {
        return ebookRedate;
    }

    /**
     * 
     */
    public void setEbookRedate(Date ebookRedate) {
        this.ebookRedate = ebookRedate;
    }

    /**
     * 
     */
    public String getEbookDescribe() {
        return ebookDescribe;
    }

    /**
     * 
     */
    public void setEbookDescribe(String ebookDescribe) {
        this.ebookDescribe = ebookDescribe;
    }

    /**
     * 
     */
    public Integer getBooktypeId() {
        return booktypeId;
    }

    /**
     * 
     */
    public void setBooktypeId(Integer booktypeId) {
        this.booktypeId = booktypeId;
    }

    /**
     * 
     */
    public Integer getBrowsefrequency() {
        return browsefrequency;
    }

    /**
     * 
     */
    public void setBrowsefrequency(Integer browsefrequency) {
        this.browsefrequency = browsefrequency;
    }

    /**
     * 
     */
    public String getBookIco() {
        return bookIco;
    }

    /**
     * 
     */
    public void setBookIco(String bookIco) {
        this.bookIco = bookIco;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Ebook other = (Ebook) that;
        return (this.getEbookId() == null ? other.getEbookId() == null : this.getEbookId().equals(other.getEbookId()))
            && (this.getEbookName() == null ? other.getEbookName() == null : this.getEbookName().equals(other.getEbookName()))
            && (this.getEbookAuthor() == null ? other.getEbookAuthor() == null : this.getEbookAuthor().equals(other.getEbookAuthor()))
            && (this.getEbookRedate() == null ? other.getEbookRedate() == null : this.getEbookRedate().equals(other.getEbookRedate()))
            && (this.getEbookDescribe() == null ? other.getEbookDescribe() == null : this.getEbookDescribe().equals(other.getEbookDescribe()))
            && (this.getBooktypeId() == null ? other.getBooktypeId() == null : this.getBooktypeId().equals(other.getBooktypeId()))
            && (this.getBrowsefrequency() == null ? other.getBrowsefrequency() == null : this.getBrowsefrequency().equals(other.getBrowsefrequency()))
            && (this.getBookIco() == null ? other.getBookIco() == null : this.getBookIco().equals(other.getBookIco()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEbookId() == null) ? 0 : getEbookId().hashCode());
        result = prime * result + ((getEbookName() == null) ? 0 : getEbookName().hashCode());
        result = prime * result + ((getEbookAuthor() == null) ? 0 : getEbookAuthor().hashCode());
        result = prime * result + ((getEbookRedate() == null) ? 0 : getEbookRedate().hashCode());
        result = prime * result + ((getEbookDescribe() == null) ? 0 : getEbookDescribe().hashCode());
        result = prime * result + ((getBooktypeId() == null) ? 0 : getBooktypeId().hashCode());
        result = prime * result + ((getBrowsefrequency() == null) ? 0 : getBrowsefrequency().hashCode());
        result = prime * result + ((getBookIco() == null) ? 0 : getBookIco().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", ebookId=").append(ebookId);
        sb.append(", ebookName=").append(ebookName);
        sb.append(", ebookAuthor=").append(ebookAuthor);
        sb.append(", ebookRedate=").append(ebookRedate);
        sb.append(", ebookDescribe=").append(ebookDescribe);
        sb.append(", booktypeId=").append(booktypeId);
        sb.append(", browsefrequency=").append(browsefrequency);
        sb.append(", bookIco=").append(bookIco);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}